// import axios from 'axios'
// // 方法return是promise
// export const login = function (user = {}) {
//   return axios.post('http://127.0.0.1:3000/api/v1/login', user)
// }

import request from '@/util/request.js'

export const login = function (user = {}) {
  return request.post('/login', user, {
    isPublic: true // 自定义的配置,表示该接口不需要授权
  })
}

export const selectUserMenu = function () {
  return request.get('/menus')
}

export const selectTeacherOptions = function (params = {}) {
  return request.get('/auth/teacher', {
    params
  })
}

// 获取角色数据
export const getRoleAPI = () => {
  return request.get('/auth/role')
}
